package com.example.langchain4jhelloword.config;

import dev.langchain4j.model.chat.ChatModel;
import dev.langchain4j.model.chat.request.ChatRequestParameters;
import dev.langchain4j.model.openai.OpenAiChatModel;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author wwl
 * 日期  2025/9/17 17:10
 * 版本 1.0
 * 描述 :
 */
@Configuration
public class LLMConfig {
    @Bean("qwen3")
    public ChatModel chatModelQwen(){
        ChatRequestParameters requestParameters = ChatRequestParameters.builder()
                .maxOutputTokens(1024)
                .stopSequences("</s>")
                .build();
        //"sk-108b9e32c372425a8207c024d1af4b09"
        return OpenAiChatModel.builder()
                .apiKey(System.getenv("aliQwen-api"))
                .modelName("qwen3-max-preview")
                .baseUrl("https://dashscope.aliyuncs.com/compatible-mode/v1")
                .defaultRequestParameters(requestParameters)
                .build();
    }

    @Bean("mini")
    public ChatModel chatModelDeepSeek(){
        ChatRequestParameters requestParameters = ChatRequestParameters.builder()
                .maxOutputTokens(1024)
                .stopSequences("</s>")
                .build();
        //"sk-bb989ed5575241ea82697c0ef4930333"
        return OpenAiChatModel.builder()
                .apiKey(System.getenv("mini"))
                .modelName("kimi-k2-0905-preview")
                .baseUrl("https://api.moonshot.cn/v1")
                .defaultRequestParameters(requestParameters)
                .build();
    }
}
